home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 027a / proplus.zip / SAMPLE1.PRG < prev    next >
Text File  |  1991-03-14  |  7KB  |  209 lines

  1. PUBLIC pp_cfile, demo_ver
  2. PRIVATE password, get_code, choice, exe_limit
  3. pp_cfile="SAMPLE"
  4. if !pp_getvar()
  5.     ? "Error reading control file... Call technical support!"
  6.     ?
  7.     cancel
  8. endif
  9. if pp_expired()
  10.     ? "Sorry, but the demo for this product has expired... Please call and"
  11.     ? "order from C.R.S. at 614-676-2771"
  12.     ?
  13.     pp_upddate()
  14.     cancel
  15. endif
  16. if !pp_valdate() .AND. pp_exptype()#"N"
  17.     clear
  18.     curr_date=date()
  19.     curr_time=time()
  20.     @ 2,0 say "Please set the date and time correctly:"
  21.     ?
  22.     ?
  23.     run date
  24.     @ 7,0 say "" 
  25.     run time
  26. endif
  27. if !pp_valdate() .AND. pp_exptype()#"N"
  28.     clear
  29.     @ 2,0 say "The date and time is still incorrect.  Please call technical support"
  30.     @ 3,0 say "for assistance.              Code entry #: "+ltrim(str(pp_cenum()))+"  Date: "+dtoc(date())
  31.     propl0=4500
  32.     get_code=0
  33.     @ 5,0 say "Enter code: " get get_code picture "@Z"
  34.     read
  35.     if pp_ucode(get_code)=5
  36.         pp_upddate()
  37.         pp_getvar()     
  38.     else
  39.         clear
  40.         cancel
  41.     endif
  42. endif
  43. exe_limit=( pp_exptype() = "E" )
  44. if iscolor()
  45.     setcolor("w+/b")
  46. else
  47.     setcolor("w")
  48. endif
  49. clear
  50. set scoreboard off
  51. @ 0,0 to 24,79
  52. @ 1,13 say "P R O T E C T I O N   P L U S   F O R   C L I P P E R"
  53. @ 4,2 say "    Serial: "+pp_serial()+"/"+ltrim(str(pp_compno()))
  54. @ 5,2 say "Code entry: "+ltrim(str(pp_cenum()))
  55. propl0=4500
  56. @  4,64 say "Date: "+dtoc(date())
  57. @  5,59 say "Last used: "+dtoc(propl17)                      
  58. @  6,70 say propl18                                          
  59. @  7,61 say if(!empty(propl10),"Expires: "+dtoc(propl10),"") 
  60. @  8,24 say "Protection plus sample program!"
  61. @ 10,22 say "This is your power-up screen routine"
  62. set key -4 to ucode
  63. password=space(8)
  64. do while empty(password) .AND. !lastkey()=27
  65.     @ 20,28 clear to 20,60
  66.     @ 20,30 say "Password: " get password picture "@!"
  67.     read
  68. enddo
  69. set key -4 to 
  70. if password#"PROPLUS "
  71.     pp_upddate()
  72.     set color to
  73.     clear
  74.     @ 2,0 say "Incorrect password entered, program aborted!"
  75.     @ 4,0 say ""
  76.     cancel
  77. endif 
  78. if exe_limit
  79.     pp_advect()
  80. endif
  81. clear
  82. @ 0,0 to 24,79
  83. @ 1,13 say "P R O T E C T I O N   P L U S   F O R   C L I P P E R"
  84. choice=1
  85. @ 7,3 to 12,20 
  86. do while .T.
  87.     @ 2,21 clear to 23,78
  88.     @  7,7 say "MAIN MENU"
  89.     @  8,5 prompt "View variables"
  90.     @  9,5 prompt "Edit variables"
  91.     @ 10,5 prompt "Macro entry   "
  92.     @ 11,5 prompt "Exit program  "
  93.     @ 6,29 say "This is the Protection Plus sample program MAIN"
  94.     @ 7,29 say "MENU.  There are some choices here that allow"
  95.     @ 8,29 say "you to test out some of the features of the "
  96.     @ 9,29 say "Protection Plus library.  Look the the source"
  97.     @ 10,29 say "file SAMPLE.PRG for a full description of all"
  98.     @ 11,29 say "the library functions used in this sample"
  99.     @ 12,29 say "program.  It is EASY to implement the source"
  100.     @ 13,29 say "changes in your own existing applications!"
  101.     menu to choice
  102.     do case
  103.         case choice=1
  104.             @ 2,21 clear to 23,78
  105.             @  5,34 SAY "Company: "+propl1
  106.             @  6,34 SAY "   Name: "+propl2
  107.             @  7,34 SAY "Address: "+propl3
  108.             @  8,34 SAY "   City: "+propl4+", "+propl5+"  "+propl6
  109.             @  9,34 SAY "  Phone: "+propl7
  110.             @ 10,34 SAY "Product: "+propl8
  111.             @ 11,34 SAY "Serial#: "+propl9
  112.             @ 12,34 SAY "Expires: "+dtoc(propl10)
  113.             @ 13,34 SAY "Company: "+propl12
  114.             @ 14,34 SAY "Address: "+propl13
  115.             @ 15,34 SAY "         "+propl14
  116.             @ 16,34 SAY "  Phone: "+propl15
  117.             @ 17,34 SAY "    FAX: "+propl16
  118.             @ 18,34 SAY "Last     "+dtoc(propl17)
  119.             @ 19,34 SAY "   Used: "+propl18
  120.             @ 21,34 say "Press any key..."
  121.             inkey(0)
  122.         case choice=2
  123.             @ 2,21 clear to 23,78
  124.             @  5,34 SAY "Company: " get propl1
  125.             @  6,34 SAY "   Name: " get propl2
  126.             @  7,34 SAY "Address: " get propl3
  127.             @  8,34 SAY "   City: " get propl4
  128.             @  8,61 get propl5
  129.             @  8,65 get propl6
  130.             @  9,34 SAY "  Phone: " get propl7
  131.             @ 10,34 SAY "Product: " get propl8
  132.             @ 11,34 SAY "Serial#: " get propl9
  133.             @ 12,34 SAY "Expires: " get propl10
  134.             @ 13,34 SAY "Company: " get propl12
  135.             @ 14,34 SAY "Address: " get propl13
  136.             @ 15,34 SAY "         " get propl14
  137.             @ 16,34 SAY "  Phone: " get propl15
  138.             @ 17,34 SAY "    FAX: " get propl16
  139.             @ 18,34 SAY "Last     " get propl17
  140.             @ 19,34 SAY "   Used: " get propl18
  141.             read
  142.             if lastkey()#27
  143.                 pp_savepp()
  144.             endif
  145.         case choice=3
  146.             do while lastkey()#27
  147.                 @ 2,21 clear to 23,78
  148.                 string=space(50)
  149.                 @ 10,30 say "Enter macro string:" get string picture "@S20"
  150.                 @ 11,30 say "<ESC> to abort"
  151.                 read
  152.                 if lastkey()#27
  153.                     @ 15,30 say "Result:"
  154.                     @ 15,38 say &string
  155.                     @ 17,30 say "Press any key.."
  156.                     inkey(0)
  157.                 endif
  158.             enddo
  159.         otherwise
  160.             exit_program()
  161.     endcase
  162. enddo .T.
  163. return
  164. FUNCTION exit_program
  165.     pp_upddate()
  166.     set color to
  167.     clear
  168.     cancel
  169. return .T.
  170. FUNCTION ucode
  171.     PRIVATE _routine
  172.     clear gets
  173.     get_code=0
  174.     @ 20,28 say "Enter code: " get get_code picture "@Z"
  175.     read
  176.     if lastkey()=27
  177.         retu .T.
  178.     endif
  179.     _routine=pp_ucode(get_code)
  180.     set color to 
  181.     clear
  182.     do case
  183.         case _routine=1                         
  184.             if pp_unlock()
  185.                 @ 2,0 say "Application unlocked..."
  186.             endif
  187.         case _routine=2                         
  188.             if pp_nexptype("P",pp_npdate(date(),20))
  189.                 @ 2,0 say "Application payment expire date extended to "+dtoc(pp_npdate(date(),20))
  190.             endif
  191.         case _routine=3                         
  192.             if pp_killprot()
  193.                 @ 2,0 say "Protection erased!"
  194.             endif
  195.         case _routine=4
  196.             if pp_nexptype("D",ctod("4/10/91"))
  197.                 @ 2,0 say "Application demo expire date set to 4/1/91"
  198.             endif
  199.         case _routine=10                        
  200.             pp_copywrite()
  201.         case _routine=0                         
  202.             retu .F.
  203.         otherwise                               
  204.             @ 2,0 say "Routine # to be executed ="+str(_routine)
  205.     endcase
  206.     @ 4,0 say ""
  207.     exit_program()
  208. return .T.
  209.